<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="0" />
<meta name="acc" content="detect" />
	<script>

$(document).ready(function() {
	$("#reportStartdate").addClass("Wate").bind("click", function() {
		WdatePicker({
			skin : 'whyGreen',
			minDate : '1900-10-01',
			maxDate : '%y-%M-%d',
			dateFmt : 'yyyy-MM-dd'
		});
	});
	$("#reportEnddate").addClass("Wate").bind("click", function() {
		WdatePicker({
			skin : 'whyGreen',
			minDate : '1900-10-01',
			maxDate : '%y-%M-%d',
			dateFmt : 'yyyy-MM-dd'
		});
	});
	});
	
function ExcelBatch(id,projectId){
	var startTime = $("#reportStartdate").val();
	var endTime = $("#reportEnddate").val();
	$.window.prepare({
		   dock: 'left'       // change the dock direction: 'left', 'right', 'top', 'bottom'
		});
	sampleWnd = $.window({
		title: "批次列表选择",
		showFooter: false,
		maximizable:true,
		bookmarkable:false,
		showModal: true,
		width: 800,
		height: 550,
		resizable:true,
		scrollable:true,
		showRoundCorner: true,
		createRandomOffset: {x:0, y:0},
		modalOpacity: 0.5,
		url: appConfig.contPath+"/detect/detect!windows.action?projectId="+projectId+"&id="+id+"&startTime="+startTime+"&endTime="+endTime
	});
	sampleWnd.maximize();
}
function close(){
	 $.window.closeAll(); 
}
function batch(batch,startTime,endTime){
	openWindowAsDialog('${ctx }/detect/detect!excelOut.action?projectId=${projectId}&batch='+batch+"&startTime="+startTime+"&endTime="+endTime,{width:50,height:60});
}
function batchPro(startTime,endTime){
	openWindowAsDialog('${ctx}/detect/detect!excelOutDif.action?projectId=${projectId}&startTime='+startTime+'&endTime='+endTime,{width:50,height:60});
}
function Excel(id,projectId){
	openWindowAsDialog('${ctx}/detect/detect!excel.action?projectId='+projectId+'&filter_EQS_id='+id+'&id='+id,{width:50,height:60});

}
	</script>
</head>
<body>
<div id="heading" class="detect"><h6><pt:labels type="proj" argument1="${projectId }" single="true"/>工程试验检测</h6></div>
<form action="${ctx }/detect/detect!proj.action" method="get" id="mainForm"
	class='yform'>
	<input type="hidden" name="projectId" value="${projectId }"/>
<div id="filter">
<ul>
	<li>提交时间:<input type="text" id="reportStartdate"
		name="filter_GED_reportdate" value="${param['filter_GED_reportdate']}" />
		——
		<input type="text" id="reportEnddate"
		name="filter_LED_reportdate" value="${param['filter_LED_reportdate']}" />
		</li>
		<li>
		合同段:
		<pt:labels type="sign" argument1="${projectId}" default="${param['filter_EQS_signid']}"
							name="filter_EQS_signid" ></pt:labels> 
							</li>
</ul>
<div class="type-button"><input type="button" onclick="search();"
	class="search" value="查询" /></div>
</div>
<div id="content">
<table>
	<tr>
		<th>抽检总点数（个）</th>
		<th>合格总点数（个）</th>
		<th>合格率（%）</th>
		<th>标段</th>
		<th>批次</th>
		<th>提交时间</th>
		<th>操作</th>
		<c:forEach items="${page.result}" var="spotrespot">
			<tr>
				<td>${spotrespot.allCount}</td>
				<td>${spotrespot.allPass}</td>
				<td>${spotrespot.allTotalPassrate}</td>
				<td><pt:labels type="sign" argument1="${spotrespot.signid}" single="true"></pt:labels></td>
				<td>${spotrespot.batch}</td>
				<td>${spotrespot.reportdate}</td>
				<td>
				<a href="${ctx}/detect/detect!input.action?projectId=${projectId}&id=${spotrespot.id}&decorator=${param.decorator}&confirm=${param.confirm}&nav=0">编辑</a>&nbsp;
				<a href="${ctx}/detect/detect!delete.action?projectId=${projectId }&id=${spotrespot.id}&decorator=${param.decorator}&confirm=${param.confirm}&nav=0" >删除</a>&nbsp;
				<a href="javascript:ExcelBatch('${spotrespot.id}','${projectId }');">导出为Excel</a>&nbsp;
				
				</td>
			</tr>
		</c:forEach>
</table>
</div>
<jsp:include page="/common/page.jsp" flush="true" />
<div class="type-button">
<input  type="button" class="add" onclick="location.href='${ctx}/detect/detect!input.action?projectId=${projectId}&decorator=${param.decorator}&confirm=${param.confirm}&nav=0'"  value="新增" />&nbsp;
<c:choose>
	<c:when test="${count != '0'}">
<a href="javascript:ExcelBatch('','${projectId}')" class="excel">批次选择</a>
	</c:when>
</c:choose>
<input  type="button" value="返回" class="reset" onclick="history.back();"/>
</div>
</form>
</body>
